<template>
  <div>
    <h2>测试题 <button @click="add">加试</button></h2>
    <!-- 使用组件 -->
    <math-com v-for="(item, index) in arr" :key="'math-'+index" :arr="arr" :index="index"></math-com>
    <result-com v-for="(item, index) in arr" :key="'result-'+index" :arr="arr" :index="index"></result-com>
  </div>
</template>

<script>
// 导入组件
import MathCom from './components/math-com.vue'
import ResultCom from './components/result-com.vue'
export default {
  // 注册组件
  components: { MathCom, ResultCom },
  data () {
    return {
      arr: [0, 0, 0, 0, 0]
    }
  },
  methods: {
    add () {
      this.arr.push(0)
    }
  }
}
</script>

<style>

</style>
